public OnPlayerCommandReceived(playerid, cmdtext[]) {
	if (playerData[playerid][isSpawned] == false) {
		SendClientMessage(playerid, C_RED, "* Error: You can't use that command while you are not spawned.");
		return false;
	}
	
	if (playerData[playerid][activeDM] > -1 && (         strfind(cmdtext, "/sync", true) == -1 &&
														 strfind(cmdtext, "/dm", true) == -1 &&
														 strfind(cmdtext, "/exit", true) == -1 &&
														 strfind(cmdtext, "/dmspawn", true) == -1 &&
														 strfind(cmdtext, "/s", true) == -1 &&
														 strfind(cmdtext, "/me", true) == -1)) {
		SendClientMessage(playerid, C_RED, "* Error: You can't use this command while you are in a deathmatch.");
		return false;
	}
	
	if (playerData[playerid][isPlaying] && (			   strfind(cmdtext, "/sync", true) == -1 && 
														   strfind(cmdtext, "/gunmenu", true) == -1 && 
														   strfind(cmdtext, "/kill", true) == -1 &&
														   strfind(cmdtext, "/me", true) == -1 &&
														   strfind(cmdtext, "/v", true) == -1 &&
														   strfind(cmdtext, "/s", true) == -1 &&
														   playerData[playerid][level] == 0)) {												
		SendClientMessage(playerid, C_RED, "* Error: You can't use this command while you are playing in a base.");
		return false;
	}
	
	return true;
}